<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>表单新增的元素</title>
</head>

<body>

    <form action="" method="">
        专业:
        <select>
            <option value="1">java</option>
            <option value="2">HTML</option>
            <option value="3">Swift</option>
            <option value="4">C++</option>
        </select>
        <br>
        <br>
        <br>

        <!-- 不仅仅可以选择,还可以输入 -->
        <!-- 使用list 与datalist进行关联 -->
        专业2:
        <input type="text" list="subjects">
        <datalist id="subjects">
            <option value="java" label="懒洋洋">
                <option value="HTML" label="喜洋洋">
                    <option value="Swift" label="大灰狼">
                        <option value="C++" label="...">

        </datalist>
        <br>
        <br>
        <br> 网址:
        <input type="url" list="urlSubjects">
        <datalist id="urlSubjects">
            <!-- 如果input为url类型,则value必须符合HTTP协议 -->
            <option value="https://www.baidu.com" label="懒洋洋">
                <option value="https://www.github.com" label="喜洋洋">
                    <option value="https://www.17173.com" label="大灰狼">

        </datalist>

    </form>




</body>

</html>
